{extend name="index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">VIP等级管理</div>
    <div class="layui-card-body">
        <div class="layui-form">
            <table class="layui-hide" id="currentTable" lay-filter="currentTable"
            data-auth-add="{:$auth->check('auth.vip/add')}"
            data-auth-edit="{:$auth->check('auth.vip/edit')}"
            data-auth-delete="{:$auth->check('auth.vip/del')}" ></table>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script>
layui.use('yznTable', function() {
    var table = layui.yznTable;

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTable',
        add_url: "{:url('add')}",
        edit_url: "{:url('edit')}",
        delete_url: "{:url('del')}",
        modify_url: '{:url("multi")}',
    };

    table.render({
        init: init,
        toolbar: ['refresh','add'],
        url: '{:url("index")}?sort=listorder',
        search:false,
        cols: [
            [
                { field: 'id', width: 80, title: 'ID' },
                { field: 'listorder', width: 100, title: '排序', edit: 'text' },
                { field: 'level', width: 80,align: 'left', title: '等级'},
                { field: 'title',  align: 'left', title: '名称'},
                { field: 'days',  align: 'left', title: '天数'},
                { field: 'amount', align: 'left', title: '价格'},
                { field: 'status', width: 80,title: '状态',templet: yznTable.formatter.status,selectList:{0:'禁用',1:'正常'},search:false},
                { field: 'create_time', width: 180, title: '创建时间', search: 'range' },
                { width:100, title: '操作',templet: yznTable.formatter.tool,operat: ['edit','delete']}
            ]
        ],
    });

    yznTable.bindevent();
});
</script>
{/block}